package org.example;

public class Product {
    private String name;
    private double price;

    // 无参构造函数
    public Product() {}

    // 有参构造函数（可选）
    public Product(String name, double price) {
        this.name = name;
        this.price = price;
    }

    // Getter 和 Setter 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Product{name='" + name + "', price=" + price + '}';
    }
}